<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8" />
<link rel="apple-touch-icon" href="/style/assets/img/apple_touch.png">
<title>概览</title>
<?php include($this->c['_homes']['_viewsHome'].'/_global/_head.php');?>
<style>
.dashboard-stat .visual{height:130px;}
.dashboard-stat .details .number{font-size:18px;line-height: 20px;}
.dashboard-stat .details .desc{font-size:14px;}
</style>
</head>
<!-- BEGIN BODY -->
<body class="page-header-fixed page-sidebar-fixed">
<!-- BEGIN HEADER -->
<div class="header navbar navbar-inverse navbar-fixed-top"> 
  <!-- BEGIN TOP NAVIGATION BAR -->
  <div class="header-inner"> 
    <!-- BEGIN LOGO --> 
    <a class="navbar-brand" href="/manage"> <img src="/style/assets/img/logo.png" alt="logo" class="img-responsive" /> </a> 
    <!-- END LOGO --> 
    <!-- BEGIN HORIZANTAL MENU -->
    <div class="hor-menu hidden-sm hidden-xs">
      <ul class="nav navbar-nav">
        <li class="active"> <a href="/manage"> 概览 <span class="selected"></span> </a> </li>
      </ul>
    </div>
    <!-- END HORIZANTAL MENU --> 
    <!-- BEGIN RESPONSIVE MENU TOGGLER --> 
    <a href="javascript:;" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <img src="/style/assets/img/menu-toggler.png" alt="" /> </a> 
    <!-- END RESPONSIVE MENU TOGGLER --> 
    <!-- BEGIN TOP NAVIGATION MENU -->
    <ul class="nav navbar-nav pull-right">
      <!-- BEGIN USER LOGIN DROPDOWN -->
      <li class="dropdown user"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <img alt="" src="/style/assets/img/avatar_small.png" /> <span class="username">
        <?=$this->auth['realname'];?>
        </span> <i class="icon-angle-down"></i> </a>
        <ul class="dropdown-menu">
          <li><a href="/manage/password"><i class="icon-lock"></i> 修改密码</a></li>
          <li class="divider"></li>
          <li><a href="/manage/signout"><i class="icon-key"></i> 退出登录</a></li>
        </ul>
      </li>
      <!-- END USER LOGIN DROPDOWN -->
    </ul>
    <!-- END TOP NAVIGATION MENU --> 
  </div>
  <!-- END TOP NAVIGATION BAR --> 
</div>
<!-- END HEADER -->
<div class="clearfix"></div>
<!-- BEGIN CONTAINER -->
<div class="page-container" > 
  <!-- BEGIN HORIZONTAL MENU PAGE SIDEBAR1 -->
  <?php include($this->c['_homes']['_viewsHome'].'/_global/menu.php');?>
  <!-- END BEGIN HORIZONTAL MENU PAGE SIDEBAR --> 
  <!-- BEGIN PAGE --> 
  <!-- BEGIN PAGE -->
  <div class="page-content">     
    <!-- BEGIN PAGE HEADER-->
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title"> 概览 <small>Dashboard</small> </h3>
        <ul class="page-breadcrumb breadcrumb">
          <li> <i class="icon-home"></i> <a href="/manage">后台</a> <i class="icon-angle-right"></i> </li>
          <li>概览</li>          
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB--> 
      </div>
    </div>
    <!-- END PAGE HEADER--> 
    <!-- BEGIN DASHBOARD STATS -->
  
    <div class="row">
      <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
        <div class="dashboard-stat red">
          <div class="visual"> <i class="icon-group"></i> </div>
            <div class="details">                
                <div class="number">
                    <?=$this->user['today'] ? : 0;?>
                </div>
                <div class="desc"> 今日新增 </div>
                <div class="number">
                    <?=$this->user['total'] ? : 0;?>
                </div>
                <div class="desc"> 用户总数 </div>
            </div></div>
      </div>
      <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
        <div class="dashboard-stat blue">
          <div class="visual"> <i class="icon-bar-chart"></i> </div>
          <div class="details">            
             <div class="number">
              <?=$this->stock['today']['number'] ? : 0;?>
            </div>
            <div class="desc"> 今日出库数量</div>
            <div class="number">
              <?=$this->stock['today']['money'] ? : 0;?>
            </div>
            <div class="desc"> 今日出库金额 </div>
          </div></div>
      </div>      
      <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
        <div class="dashboard-stat purple">
          <div class="visual"> <i class="icon-jpy"></i> </div>
          <div class="details">
            <div class="number">
              <?=$this->moneytoday ?  : 0 ;?>
            </div>
            <div class="desc">今日分润</div>            
          </div></a> 
          </div>
      </div>
      

    </div>
   
   
    <!-- END DASHBOARD STATS -->
    <div class="clearfix"></div>
    <div class="row">
      <div class="col-md-6 col-sm-6">
      <div id="container_member" style="width:100%;height:400px;margin:0px;">用户数据加载中...</div>
      </div>
      <div class="col-md-6 col-sm-6">
      <div id="container_order" style="width:100%;height:400px;margin:0px;">出库数据加载中...</div>
      </div>
    </div>
     
  </div>
  <!-- END PAGE --> 
</div>
<!-- END CONTAINER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/_footer.php');?>
<script type="text/javascript" src="/style/chart/highcharts.js"></script>
<script type="text/javascript" src="/style/chart/exporting.js"> </script>
<!-- BEGIN PAGE LEVEL SCRIPTS --> 
<script src="/style/assets/scripts/app.js" type="text/javascript"></script> 
<!-- END PAGE LEVEL SCRIPTS --> 
<script>
jQuery(document).ready(function() {    
   App.init();   
});

$(function () {
    $("#container_member").highcharts({
        chart: {
            type: 'line'
        },
        title: {
            text: '<?=$this->chart['date'];?>用户增长走势'
        },
		credits:{
			enabled:0	
		},
        subtitle: {
            text: '<?=$this->chart['start'];?>~<?=$this->chart['end'];?>'
        },
        xAxis: {
            categories: [<?php for($i=1;$i<=$this->chart['maxday'];$i++){
					if($i<=$this->chart['eofday']){
						if($i>1) echo ",";
						echo "'".$i."'";
					}
				} ?>]
        },
        yAxis: {
			min: 0,
            title: {
                text: '数量（人）'
            }
        },
        tooltip: {
            enabled: true,
            formatter: function() {
                return '<b>'+ this.series.name +'</b><br/>'+this.x +': '+ this.y +'°C';
            }
        },
        plotOptions: {
            line: {
                dataLabels: {
                    enabled: true
                },
                enableMouseTracking: false
            }
        },
        series: [{
            name: '数量',
            data: [<?php for($i=1;$i<=$this->chart['maxday'];$i++){
				
					if($i<=$this->chart['eofday']){
					
						if($i>1) echo ",";
						if($this->user['month'][$i]) echo $this->user['month'][$i];
						else echo 0;
					}
				} ?>]
        }]
    });


	
	$("#container_order").highcharts({
        chart: {
            type: 'column'
        },
        title: {
            text: '<?=$this->chart['date'];?>出库数量与金额'
        },
        subtitle: {
            text: '<?=$this->chart['start'];?>~<?=$this->chart['end'];?>'
        },
		credits:{
			enabled:0	
		},
        xAxis: {
            categories: [<?php for($i=1;$i<=$this->chart['maxday'];$i++){
					if($i<=$this->chart['eofday']){
						if($i>1) echo ",";
						echo "'".$i."'";
					}
				} ?>]
        },
        yAxis: {
            min: 0,
            title: {
                text: '数量(单/元)'
            }
        },
        tooltip: {
            headerFormat: '<span style="font-size:10px">日期：{point.key}</span><table>',
            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                '<td style="padding:0"><b>{point.y}</b></td></tr>',
            footerFormat: '</table>',
            shared: true,
            useHTML: true
        },
        plotOptions: {
            column: {
                pointPadding: 0.2,
                borderWidth: 0
            }
        },
        series: [{
            name: '出库数量',
            data: [<?php for($i=1;$i<=$this->chart['maxday'];$i++){
				
					if($i<=$this->chart['eofday']){
					
						if($i>1) echo ",";
						if($this->stock['month']['number'][$i]) echo $this->stock['month']['number'][$i];
						else echo 0;
					}
				} ?>]

        }, {
            name: '出库金额',
            data: [<?php for($i=1;$i<=$this->chart['maxday'];$i++){
				
					if($i<=$this->chart['eofday']){
					
						if($i>1) echo ",";
						if($this->stock['month']['money'][$i]) echo $this->stock['month']['money'][$i];
						else echo 0;
					}
				} ?>]

        }]
    });

   
});
</script> 
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>